/*
 * Copyright (c) 2023-2299 深圳市阿毛科技有限公司 All rights reserved.
 *
 * https://www.lamyz.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.lam.mall.app.vo;

import java.util.List;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lam.common.serializer.json.ImgJsonSerializer;
import com.lam.mall.common.util.ProductUtil;
import com.lam.mall.entity.SkuProperties;
import com.lam.mall.entity.TransFeeTemplate;

/**
 */
public class ProductVo {
    /**
     * 店铺ID
     */
    private String shopId;

    /**
     * 店铺名称
     */
    private String shopName;

    /**
     * 商品ID
     */
    private String id;

    /**
     * 商品名称
     */
    private String prodName;

    /**
     * 商品价格
     */
    private Double price;

    /**  商品详情 */
    private String content;

    /** 商品原价 */
    private Double oriPrice;

    /** 库存量 */
    private Integer totalStocks;

    /**
     * 简要描述,卖点等
     */
    private String brief;

    /** 商品主图 */
    @JsonSerialize(using = ImgJsonSerializer.class)
    private String pic;

    @JsonSerialize(using = ImgJsonSerializer.class)
    private String imgs;

    /**
     * 商品分类
     */
    private String categoryId;

    private List<SkuVo> skuList;

    //"运费信息" , required = true)
    private TransFeeTemplate transFeeTemplate;
    
    /** sku规格属性 */
    private String skuProperties;
    
    /** sku列表 */
    private List<SkuProperties> skuPropertiesList;
    
    public void convertProperties(boolean reverse) {
    	if(reverse) {
			this.skuPropertiesList = ProductUtil.prodProperties2List(skuProperties);
    		return;
    	}
    	skuProperties = ProductUtil.list2ProdProperties(skuPropertiesList);
    }

	public String getShopId() {
		return shopId;
	}

	public void setShopId(String shopId) {
		this.shopId = shopId;
	}

	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public String getProdName() {
		return prodName;
	}

	public void setProdName(String prodName) {
		this.prodName = prodName;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Double getOriPrice() {
		return oriPrice;
	}

	public void setOriPrice(Double oriPrice) {
		this.oriPrice = oriPrice;
	}

	public Integer getTotalStocks() {
		return totalStocks;
	}

	public void setTotalStocks(Integer totalStocks) {
		this.totalStocks = totalStocks;
	}

	public String getBrief() {
		return brief;
	}

	public void setBrief(String brief) {
		this.brief = brief;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public String getImgs() {
		return imgs;
	}

	public void setImgs(String imgs) {
		this.imgs = imgs;
	}

	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}

	public List<SkuVo> getSkuList() {
		return skuList;
	}

	public void setSkuList(List<SkuVo> skuList) {
		this.skuList = skuList;
	}

	public TransFeeTemplate getTransFeeTemplate() {
		return transFeeTemplate;
	}

	public void setTransFeeTemplate(TransFeeTemplate transFeeTemplate) {
		this.transFeeTemplate = transFeeTemplate;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getSkuProperties() {
		return skuProperties;
	}

	public void setSkuProperties(String skuProperties) {
		this.skuProperties = skuProperties;
	}

	public List<SkuProperties> getSkuPropertiesList() {
		return skuPropertiesList;
	}

	public void setSkuPropertiesList(List<SkuProperties> skuPropertiesList) {
		this.skuPropertiesList = skuPropertiesList;
	}


}
